package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagPhaseDtoMapper;
import com.starlink.model.domain.SchoolbagPhaseDO;
import com.starlink.model.vo.SchoolbagPhaseVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagPhaseConvert {

    public static List<SchoolbagPhaseVO> buildSchoolbagPhaseVoList(List<SchoolbagPhaseDO> schoolbagPhaseDOList) {
        if (CollectionUtils.isEmpty(schoolbagPhaseDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagPhaseVO> schoolbagPhaseVOList = new ArrayList<>();
        for (SchoolbagPhaseDO schoolbagPhaseDO : schoolbagPhaseDOList) {
            schoolbagPhaseVOList.add(SchoolbagPhaseDtoMapper.INSTANCE.do2VO(schoolbagPhaseDO));
        }

        return schoolbagPhaseVOList;
    }
}
